package com.tc.filter;

import com.tc.entity.UserInfo;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

public class FilterChain {
    private List<Filter> filters = new ArrayList<>();
    private List<UserInfo> userInfos=new ArrayList<>();

    public void doFilter() {
        if(filters!=null)
         for(Filter f:filters){
             f.doFilter(this);
         }
    }

    public List<Filter> getFilters() {
        return filters;
    }

    public void setUserInfos(List<UserInfo> userInfos) {
        this.userInfos = userInfos;
    }

    public List<UserInfo> getUserInfos() {

        return userInfos;
    }

    public void setFilters(List<Filter> filters) {
        this.filters = filters;
    }

    public FilterChain addFilter(Filter f){
        this.filters.add(f);
        return this;
    }
}  